/*
 * @Author: hmhvictory 1400628624@qq.com
 * @Date: 2025-07-21 17:14:44
 * @LastEditors: hmhvictory 1400628624@qq.com
 * @LastEditTime: 2025-07-21 19:17:13
 * @FilePath: \实训笔记\day06\Test01.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import java.util.Scanner;

import java.util.Scanner;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 上半部分
        for (int i = 1; i <= 4; i++) {
            // 输出空格
            for (int j = 4 - i; j > 0; j--) {
                System.out.print(" ");
            }
            // 输出*
            for (int k = 1; k <= 2 * i - 1; k++) {
                System.out.print("*");
            }
            // 输出行号
            System.out.println(" " + i);
        }
        // 下半部分
        for (int i = 3; i >= 1; i--) {
            // 输出空格
            for (int j = 4 - i; j > 0; j--) {
                System.out.print(" ");
            }
            // 输出*
            for (int k = 1; k <= 2 * i - 1; k++) {
                System.out.print("*");
            }
            // 输出行号
            System.out.println(" " + (5 - i));
        }
    }
}



